package org.cytoscape.myapp.cytoscape_app_v1.internal.tasks.metrics;

import org.cytoscape.model.CyNetwork;
import org.cytoscape.myapp.cytoscape_app_v1.internal.helpers.ModelUtils;
import org.cytoscape.myapp.cytoscape_app_v1.internal.metrics.Facade;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskMonitor;

public class CalculateSocialCohesionTask implements Task{
	
	private Facade facade;
	private CyNetwork cyNetwork;
	
	public CalculateSocialCohesionTask(Facade facade,
			CyNetwork cyNetwork) {
		super();
		this.facade = facade;
		this.cyNetwork = cyNetwork;
	}


	public void run(TaskMonitor taskMonitor) throws Exception {
		
		double[][] sc = this.facade.getCohesion();
		
		ModelUtils.updateTableEdge("Social Cohesion", sc, this.facade.getMapping(), this.cyNetwork);
		
	}

	@Override
	public void cancel() {
		// TODO Auto-generated method stub
		
	}

}
